package com.yjy.mq;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(consumerGroup = "v10-consumer-group1",
        topic = "test-v10-topic",
        selectorType = SelectorType.TAG,
        selectorExpression = "tag1"
)
public class Tag1Consumer implements RocketMQListener<String> {

    @Override
    public void onMessage(String orderId) {
        System.out.printf("tag1消息 order:%s, time:%d%n", orderId, System.currentTimeMillis());
    }
}
